import request from '@/utils/request'

export function addCategory(data) {
  return request({
    url: '/juanbusiness/product-category/add',
    method: 'post',
    data
  })
}

export function findCategory(page, size, name, usingStatus) {
  return request({
    url: '/juanbusiness/product-category/findPage',
    method: 'get',
    params: { page: page, size: size, name: name, usingStatus: usingStatus }
  })
}

export function editCategory(data) {
  return request({
    url: '/juanbusiness/product-category/edit',
    method: 'put',
    data
  })
}

export function releaseCategory(id, operateId, usingStatus) {
  return request({
    url: '/juanbusiness/product-category/releaseDataById',
    method: 'put',
    params: { id: id, operateId: operateId, usingStatus: usingStatus }
  })
}

export function parentCategory(parentId) {
  return request({
    url: '/juanbusiness/product-category/parent',
    method: 'get',
    params: {parentId: parentId}
  })
}

export function delCategory(id) {
  return request({
    url: '/juanbusiness/product-category/del',
    method: 'delete',
    params: {id: id}
  })
}
